/**
 *
 */
package jp.seraph.jsade.perceptor;

import jp.seraph.jsade.sexpression.Node;

/**
 *
 *
 */
public class TimeBuilder implements PerceptorBuilder {

    /**
     *
     * @see jp.seraph.jsade.perceptor.PerceptorBuilder#build(jp.seraph.jsade.sexpression.Node)
     */
    public Perceptor build(Node aNode) {
        String tNowStr = aNode.getValue("now");

        if (tNowStr == null)
            throw new IllegalArgumentException("ノードの構造が想定のものと違います。");

        return new TimePerceptor(Double.parseDouble(tNowStr));
    }
}
